

public class TestCircle {
    public static void main(String[] args){
        Circle circle1=new Circle();
        System.out.println("The area of the circle radius"+circle1+"is"+circle1.getArea());
        Circle circle2=new Circle();
        System.out.println("The area of the circle radius"+circle2+"is"+circle2.getArea());
        Circle circle3=new Circle();
        System.out.println("The area of the circle radius"+circle3+"is"+circle3.getArea());
        circle2.radius=100;
        System.out.println("The area of the circle radius"+circle2.radius+"is"+circle2.getArea());
    }
}
class Circle{
    double radius;
    //默认构造
    Circle (){
        radius=1;
    }
    //带参构造
    Circle (double newRadius){
        radius=newRadius;
    }
    //求面积
    double getArea(){
        return Math.PI*radius*radius;
    }
    //求周长
    double getPermieter(){
        return 2*Math.PI*radius;
    }
    //修改半径
    void setRadius(double newRadius){
        radius=newRadius;
    }


}